<%--
  Created by IntelliJ IDEA.
  User: 20275
  Date: 2023/11/18
  Time: 16:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@include file="/pages/common/head.jsp"%>

<c:if test="${message != null}">
    <script>
        alert("${message}")
    </script>
    <% session.removeAttribute("message"); %>
</c:if>

<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">公告管理</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    公告管理 >> 寝室公告
                </div>
                <div class="panel-body">

                    <div style=" overflow-x: auto;white-space: nowrap;">
                        <div class="row">
                            <form role="form" method="get" action="${pageContext.request.contextPath}/notice/listInfo">
                                <div class="col-lg-4">
                                    <div class="input-group">
                                        <input type="hidden" value="1" name="power">
                                        <input type="text" class="form-control" name="find_title" placeholder="标题">
                                        <span class="input-group-btn">
                                                <button class="btn btn-default" id="find_title_button" type="submit">查找</button>
                                            </span>




                                    </div>
                                </div>
                            </form>
                            <div class="col-lg-4" style="visibility: hidden;"></div>
                            <div class="col-lg-4" style="visibility: hidden;"></div>
                        </div>
                        <br />
                        <table width="100%" class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>公告标题</th>
                                <th>内容</th>
                                <th>发布者</th>
                                <th>发布日期</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                                <c:forEach varStatus="i" items="${noticeInfo}" var="Info">
                                    <tr>
                                        <td>${i.index + 1}</td>
                                        <td style="display: none">${Info.noticeId}</td>
                                        <td>${Info.noticeTitle}</td>
                                        <td>${fn:substring(Info.noticeContent, 0, 10)}</td>
                                        <td>${Info.noticePublisher}</td>
                                        <td>${Info.noticeDate}</td>

                                        <td>
                                            <p>
                                                <a href="${pageContext.request.contextPath}/notice/delete?power=1&id=${Info.noticeId}"  class="btn btn-danger delete_button">删除</a>
                                            </p>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>



<%@include file="/pages/common/foot.jsp" %>
